package main


import (
"fmt"
"os"
"path/filepath"
"io/ioutil"
"reflect"
)

func chuli(canshu interface{}){
   if reflect.ValueOf(canshu).Kind() == reflect.Int {
      fmt.Println(canshu)
   }
}


func chumi(in interface{}){
    val :=    reflect.ValueOf(in)

    fmt.Println(val.Elem().Type())

    typ := reflect.TypeOf(1)

    val1 := reflect.New(typ)

    val1.Elem().SetInt(10000)
    
    val.Elem().Set(val1.Elem())

}

type OK struct{
   Key int
}


func main(){

  p := 1

  he := new(interface{})

  chumi(he)

  fmt.Println(*he)

  fmt.Println(p)


  t1 := make([]reflect.Value,2,10)
  fmt.Println(cap(t1))
  t1[0]=reflect.ValueOf(OK{Key:10})
  t1[1]=reflect.ValueOf(100)
  

  chuli(1)
  
  dst := "/"
  if fi, err := os.Stat(filepath.Dir(dst)); err == nil {
           fmt.Println(fi)
  }

   f11,_ := ioutil.ReadDir("/")

   for k,v := range f11 {
     fmt.Println(k,v.IsDir())
   }

   f1,_:= os.Getwd()
   fmt.Println(f1)
   os.Mkdir("sssssssssssssssss",os.ModePerm)
   f2,_:=   os.Create("file");
   f2.WriteString("ok\n")
   os.Remove("file")
   os.Remove("sssssssssssssssss")

}
